#region File Description
//-----------------------------------------------------------------------------
// Sky.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
#endregion

namespace Advanced_Terrain
{
    /// <summary>
    /// Runtime class for loading and rendering a textured skydome
    /// that was created during the build process by the SkyProcessor.
    /// </summary>
    public class Sky
    {
        #region Fields

        public Model Model;
        public Texture Texture;

        #endregion
        


        /// <summary>
        /// Helper for drawing the skydome mesh.
        /// </summary>
        public void Draw()
        {
            foreach (ModelMesh mesh in Model.Meshes)
            {
                foreach (Effect effect in mesh.Effects)
                {
                    effect.Parameters["View"].SetValue(Game1.viewMatrix);
                    effect.Parameters["Projection"].SetValue(CameraProperties.projectionMatrix);
                    effect.Parameters["Texture"].SetValue(Texture);
                }

                mesh.Draw(SaveStateMode.SaveState);
            }
        }
    }
}
